panel_path='/home/tzp/linshirenwu/panel/Panel-PanelPool-MB_Region-000000000000000000000008-top100.new_PanelMeta-newchina123.subtractOccupation.newAge_20151126134950'
lang_path='/home/tzp/linshirenwu/panel/Lang-CN-20151105112500'
lang_path1='/home/tzp/linshirenwu/panel/Lang-EN-20151105112500'
out_path='/home/tzp/linshirenwu/panel/Lang-CN-20151105112500_extract'
out_path1='/home/tzp/linshirenwu/panel/Lang-EN-20151105112500_extract'

panel_f=File.open(panel_path, 'r:UTF-8')
in_f=File.open(lang_path, 'r:UTF-8')
in_f1=File.open(lang_path1, 'r:UTF-8')
out_f=File.open(out_path, 'w:UTF-8')
out_f1=File.open(out_path1, 'w:UTF-8')

head=panel_f.readline.to_s
fields=head.split ','
puts fields
in_f.each do |line|
  line_s=line.to_s
  puts line_s
  if fields.any? {|field|line_s.index field}
    puts line_s
    out_f.write line_s
  end
end
in_f1.each do |line|
  line_s=line.to_s
  if fields.any? {|field|line_s.index field}
    puts line_s
    out_f1.write line_s
  end
end